package edu.yuhf.jdbcpart;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionTest {

	public static void main(String[] args) {
		String url="jdbc:oracle:thin:@localhost:1521:orcl";
		Connection connection=null;
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			connection=DriverManager.getConnection(url, "testdb","testdb");
			System.out.println("database connection success!");
		} catch (ClassNotFoundException | SQLException e) {
			System.out.println("Class not found,error message is "+e.getMessage());
		}
		
		
	}
}
